extends State

var set_up_step: int = 0
var start_up_hand_number: int = 4
var draw_start_up_cool_down: float = 0.5

func _init() -> void:
    pass

func _ready() -> void:
    pass

func enter(params: Array) -> void:
    # 开始setup阶段时
    var tb: Node2D = _get_table()
    var deck: Node2D = _get_deck()
    var hand: Node2D = _get_hands()
    var coin_stack: Node2D = _get_coin_stack()
    var heart_stack: Node2D = _get_heart_stack()

    # 暂时先生产50张卡
    deck.generate_deck(50)

    # 暂时给予5个金币
    coin_stack.add_coin(5)
    heart_stack.add_heart(5)

    # 设置步骤
    set_up_step = 0
    pass

func exit() -> void:
    pass

func update(delta: float) -> void:
    if set_up_step == 0:
        # 每零点5秒抽一张牌，抽4张
        emit_signal('suspend', 'draw_card', [start_up_hand_number, draw_start_up_cool_down])
        set_up_step = 1
    else:
        pass
    return
